package ZY10_19;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        GongSI s = new GongSI();
        s.name = "社会主义接班人";
        s.phone = 110;
        s.scope = "全球";
        s.site = "中华人民共和国";
        while (true) {
            Scanner in = new Scanner(System.in);
            System.out.println("请选择功能：");
            System.out.println("1.加入新员工，2.查看信息，3.辞退员工,4.涨薪水，5.薪水最高，0.退出");
            int a = in.nextInt();
            Yuangong s1 = new Yuangong();
            if (a == 1) {
                System.out.println("请输入姓名");
                String name = in.next();
                System.out.println("请输入工号");
                String number = in.next();
                System.out.println("请输入性别");
                String sex = in.next();
                System.out.println("请输入职务");
                String post = in.next();
                System.out.println("请输入薪水");
                int salary = in.nextInt();
                System.out.println("请输入身份证号");
                String id = in.next();
                System.out.println("请输入工作年限");
                int yearswork = in.nextInt();
                Yuangong yg = new Yuangong(number, name, sex, post, salary, id, yearswork);
                s.jiare(yg);
            } else if (a == 2) {
                s.yuangong();
//                s1.show();
            } else if (a == 3) {
                System.out.println("开除谁？");
                String Sname = in.next();
                boolean f = s.fire(Sname);
                System.out.println(f ? "开除成功" : "查无此人");
            }else if (a==4){
                System.out.println("给谁涨？");
                String m=in.next();
                boolean j= s.Salary(m);
                System.out.println(j?"涨薪成功":"大可不必");
            }else if (a==5){
                s.xinshui();
            }
                if (a == 0) {
                    break;
                }
            }
        }
    }
